package com.dxy.dxyadmin.controller;

import com.dxy.dxycommon.VO.ResultVO;
import com.dxy.dxyuser.client.UserClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * junfeng 2018/11/6 后台管理用户模块
 */
@Slf4j
@RestController
@RequestMapping("/admin")
public class UserApiController {

    @Autowired
    UserClient userClient;

    /*用户列表*/
    @RequestMapping(value = "/user/list")
    public ResultVO userList(@RequestParam("username") String username,
                             @RequestParam("phone") String phone,
                             @RequestParam("start_date") String start,
                             @RequestParam("end_date") String end,
                             @RequestParam("pageSize") Integer pageSize,
                             @RequestParam("limit") Integer limit
    ) {
        return userClient.list(username, phone, start, end, pageSize, limit);
    }

    /*删除用户*/
    @RequestMapping(value = "/user/delete")
    public ResultVO delete(@RequestParam("id") String id) {
        return userClient.delete(id);
    }


}
